import request from '@/utils/request'

// 使用模拟数据响应
const useMockData = false;

// 查询缺陷记录列表
export function listDefectRecord(query) {
  return request({
    url: '/qep/defect-record/list',
    method: 'get',
    params: query
  })
}

// 查询缺陷记录详细
export function getDefectRecord(id) {
  return request({
    url: '/qep/defect-record/' + id,
    method: 'get'
  })
}

// 根据检验任务ID查询缺陷记录
export function getDefectRecordByTaskId(inspectionTaskId) {
  return request({
    url: '/qep/defect-record/task/' + inspectionTaskId,
    method: 'get'
  })
}

// 新增缺陷记录
export function addDefectRecord(data) {
  return request({
    url: '/qep/defect-record',
    method: 'post',
    data: data
  })
}

// 修改缺陷记录
export function updateDefectRecord(data) {
  return request({
    url: '/qep/defect-record',
    method: 'put',
    data: data
  })
}

// 删除缺陷记录
export function delDefectRecord(id) {
  return request({
    url: '/qep/defect-record/' + id,
    method: 'delete'
  })
}

// 统计缺陷记录数量
export function countDefectRecord(query) {
  return request({
    url: '/qep/defect-record/count',
    method: 'get',
    params: query
  })
} 